package com.dy.springbootstudy.second_chapter_web.controller_web_code;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 视图控制器 -感觉的话，这个就是一个拦截器
 */
@Configuration
public class WebTwoConfig implements WebMvcConfigurer {

  @Override
  public void addViewControllers(ViewControllerRegistry registry) {
    registry.addViewController("/").setViewName("web/home");
  }

}
